import "./../actions/actions";
export default (state = {resourceData:{}}, action) => {
  var copyState = Object.assign({}, state);
    switch (action.type) {
      case 'GET_DATA':
        copyState.resourceData = action.resourceData
      return copyState ;
      case 'GET_INDEX':
          var datas = [
            {
                title:'正在热映',
                list:action.resourceData.nowData
            },
            {
                title:'新片速递',
                list:action.resourceData.commingData
            }
        ]
        copyState.lists = datas
        return copyState ;
      case 'GET_BOOK_DATA' :
        copyState.booksData = {
          title:'最受关注图书｜虚构类' ,
          list : action.resourceData.popular
        } ;
      return copyState ;
      default:
        return state
    }
}